import request from "../../utils/request"
const deptCount=()=>{
    //统计部门人数
    return request({
        url:"/dept/count",
        method:"get"
    })
}

const deptDelete=(id)=>{
    //删除部门
    return request({
        url:`/dept/delete/${id}`,
        method:"delete",
    })
}

const deptList=()=>{
    //获取部门列表
    return request({
        url:"/dept/list",
        method:"get"
    })
}

const deptAdd=(data)=>{
    //添加部门
    return request({
        url:"/dept/add",
        method:"post",
        data
    })
}

const deptUpdate=(data)=>{
    //修改部门
    return request({
        url:"/dept/update",
        method:"post",
        data
    })
}

const getHeader=()=>{
    //获取部长信息
    return request({
        url:"/user/getHeadUser",
        method:"get"
    })
}

export {
    deptCount,
    deptList,
    deptAdd,
    deptUpdate,
    deptDelete,
    getHeader
}